//===----------------------------------------------------------------------===//
//
// This source file is part of the Soto for AWS open source project
//
// Copyright (c) 2017-2024 the Soto project authors
// Licensed under Apache License v2.0
//
// See LICENSE.txt for license information
// See CONTRIBUTORS.txt for the list of Soto project authors
//
// SPDX-License-Identifier: Apache-2.0
//
//===----------------------------------------------------------------------===//

// THIS FILE IS AUTOMATICALLY GENERATED by https://github.com/soto-project/soto-codegenerator.
// DO NOT EDIT.

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
@_spi(SotoInternal) import SotoCore

extension ServiceCatalogAppRegistry {
    // MARK: Enums

    public enum ApplicationTagStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case failure = "FAILURE"
        case inProgress = "IN_PROGRESS"
        case success = "SUCCESS"
        public var description: String { return self.rawValue }
    }

    public enum AssociationOption: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case applyApplicationTag = "APPLY_APPLICATION_TAG"
        case skipApplicationTag = "SKIP_APPLICATION_TAG"
        public var description: String { return self.rawValue }
    }

    public enum ResourceGroupState: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case createComplete = "CREATE_COMPLETE"
        case createFailed = "CREATE_FAILED"
        case creating = "CREATING"
        case updateComplete = "UPDATE_COMPLETE"
        case updateFailed = "UPDATE_FAILED"
        case updating = "UPDATING"
        public var description: String { return self.rawValue }
    }

    public enum ResourceItemStatus: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case failed = "FAILED"
        case inProgress = "IN_PROGRESS"
        case skipped = "SKIPPED"
        case success = "SUCCESS"
        public var description: String { return self.rawValue }
    }

    public enum ResourceType: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case cfnStack = "CFN_STACK"
        case resourceTagValue = "RESOURCE_TAG_VALUE"
        public var description: String { return self.rawValue }
    }

    public enum SyncAction: String, CustomStringConvertible, Codable, Sendable, CodingKeyRepresentable {
        case noAction = "NO_ACTION"
        case startSync = "START_SYNC"
        public var description: String { return self.rawValue }
    }

    // MARK: Shapes

    public struct AppRegistryConfiguration: AWSEncodableShape & AWSDecodableShape {
        ///  Includes the definition  of a tagQuery.
        public let tagQueryConfiguration: TagQueryConfiguration?

        @inlinable
        public init(tagQueryConfiguration: TagQueryConfiguration? = nil) {
            self.tagQueryConfiguration = tagQueryConfiguration
        }

        public func validate(name: String) throws {
            try self.tagQueryConfiguration?.validate(name: "\(name).tagQueryConfiguration")
        }

        private enum CodingKeys: String, CodingKey {
            case tagQueryConfiguration = "tagQueryConfiguration"
        }
    }

    public struct Application: AWSDecodableShape {
        ///  A key-value pair that identifies an associated resource.
        public let applicationTag: [String: String]?
        /// The Amazon resource name (ARN) that specifies the application across services.
        public let arn: String?
        /// The ISO-8601 formatted timestamp of the moment when the application was created.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var creationTime: Date?
        /// The description of the application.
        public let description: String?
        /// The identifier of the application.
        public let id: String?
        ///  The ISO-8601 formatted timestamp of the moment when the application was last updated.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var lastUpdateTime: Date?
        /// The name of the application. The name must be unique in the region in which you are creating the application.
        public let name: String?
        /// Key-value pairs you can use to associate with the application.
        public let tags: [String: String]?

        @inlinable
        public init(applicationTag: [String: String]? = nil, arn: String? = nil, creationTime: Date? = nil, description: String? = nil, id: String? = nil, lastUpdateTime: Date? = nil, name: String? = nil, tags: [String: String]? = nil) {
            self.applicationTag = applicationTag
            self.arn = arn
            self.creationTime = creationTime
            self.description = description
            self.id = id
            self.lastUpdateTime = lastUpdateTime
            self.name = name
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case applicationTag = "applicationTag"
            case arn = "arn"
            case creationTime = "creationTime"
            case description = "description"
            case id = "id"
            case lastUpdateTime = "lastUpdateTime"
            case name = "name"
            case tags = "tags"
        }
    }

    public struct ApplicationSummary: AWSDecodableShape {
        /// The Amazon resource name (ARN) that specifies the application across services.
        public let arn: String?
        /// The ISO-8601 formatted timestamp of the moment when the application was created.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var creationTime: Date?
        /// The description of the application.
        public let description: String?
        /// The identifier of the application.
        public let id: String?
        ///  The ISO-8601 formatted timestamp of the moment when the application was last updated.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var lastUpdateTime: Date?
        /// The name of the application. The name must be unique in the region in which you are creating the application.
        public let name: String?

        @inlinable
        public init(arn: String? = nil, creationTime: Date? = nil, description: String? = nil, id: String? = nil, lastUpdateTime: Date? = nil, name: String? = nil) {
            self.arn = arn
            self.creationTime = creationTime
            self.description = description
            self.id = id
            self.lastUpdateTime = lastUpdateTime
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case creationTime = "creationTime"
            case description = "description"
            case id = "id"
            case lastUpdateTime = "lastUpdateTime"
            case name = "name"
        }
    }

    public struct ApplicationTagResult: AWSDecodableShape {
        ///  The application tag is in the process of being applied to a resource, was successfully applied to a resource, or failed to apply to a resource.
        public let applicationTagStatus: ApplicationTagStatus?
        ///  The message returned if the call fails.
        public let errorMessage: String?
        ///  A unique pagination token for each page of results. Make the call again with the returned token to retrieve the next page of results.
        public let nextToken: String?
        ///  The resources associated with an application
        public let resources: [ResourcesListItem]?

        @inlinable
        public init(applicationTagStatus: ApplicationTagStatus? = nil, errorMessage: String? = nil, nextToken: String? = nil, resources: [ResourcesListItem]? = nil) {
            self.applicationTagStatus = applicationTagStatus
            self.errorMessage = errorMessage
            self.nextToken = nextToken
            self.resources = resources
        }

        private enum CodingKeys: String, CodingKey {
            case applicationTagStatus = "applicationTagStatus"
            case errorMessage = "errorMessage"
            case nextToken = "nextToken"
            case resources = "resources"
        }
    }

    public struct AssociateAttributeGroupRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the application.
        public let application: String
        ///  The name, ID, or ARN  of the attribute group  that holds the attributes  to describe the application.
        public let attributeGroup: String

        @inlinable
        public init(application: String, attributeGroup: String) {
            self.application = application
            self.attributeGroup = attributeGroup
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
            request.encodePath(self.attributeGroup, key: "attributeGroup")
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, max: 512)
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, min: 1)
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/attribute-groups/[-.\\w]+)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct AssociateAttributeGroupResponse: AWSDecodableShape {
        /// The Amazon resource name (ARN) of the application that was augmented with attributes.
        public let applicationArn: String?
        /// The Amazon resource name (ARN) of the attribute group that contains the application's new attributes.
        public let attributeGroupArn: String?

        @inlinable
        public init(applicationArn: String? = nil, attributeGroupArn: String? = nil) {
            self.applicationArn = applicationArn
            self.attributeGroupArn = attributeGroupArn
        }

        private enum CodingKeys: String, CodingKey {
            case applicationArn = "applicationArn"
            case attributeGroupArn = "attributeGroupArn"
        }
    }

    public struct AssociateResourceRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the application.
        public let application: String
        ///  Determines whether an application tag is applied or skipped.
        public let options: [AssociationOption]?
        /// The name or ID of the resource of which the application will be associated.
        public let resource: String
        /// The type of resource of which the application will be associated.
        public let resourceType: ResourceType

        @inlinable
        public init(application: String, options: [AssociationOption]? = nil, resource: String, resourceType: ResourceType) {
            self.application = application
            self.options = options
            self.resource = resource
            self.resourceType = resourceType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
            try container.encodeIfPresent(self.options, forKey: .options)
            request.encodePath(self.resource, key: "resource")
            request.encodePath(self.resourceType, key: "resourceType")
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
            try self.validate(self.resource, name: "resource", parent: name, max: 256)
            try self.validate(self.resource, name: "resource", parent: name, min: 1)
            try self.validate(self.resource, name: "resource", parent: name, pattern: "^\\S+$")
        }

        private enum CodingKeys: String, CodingKey {
            case options = "options"
        }
    }

    public struct AssociateResourceResponse: AWSDecodableShape {
        /// The Amazon resource name (ARN) of the application that was augmented with attributes.
        public let applicationArn: String?
        ///  Determines whether an application tag is applied or skipped.
        public let options: [AssociationOption]?
        /// The Amazon resource name (ARN) that specifies the resource.
        public let resourceArn: String?

        @inlinable
        public init(applicationArn: String? = nil, options: [AssociationOption]? = nil, resourceArn: String? = nil) {
            self.applicationArn = applicationArn
            self.options = options
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case applicationArn = "applicationArn"
            case options = "options"
            case resourceArn = "resourceArn"
        }
    }

    public struct AttributeGroup: AWSDecodableShape {
        /// The Amazon resource name (ARN) that specifies the attribute group across services.
        public let arn: String?
        /// The ISO-8601 formatted timestamp of the moment the attribute group was created.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var creationTime: Date?
        /// The description of the attribute group that the user provides.
        public let description: String?
        /// The globally unique attribute group identifier of the attribute group.
        public let id: String?
        /// The ISO-8601 formatted timestamp of the moment the attribute group was last updated. This time is the same as the creationTime for a newly created attribute group.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var lastUpdateTime: Date?
        /// The name of the attribute group.
        public let name: String?
        /// Key-value pairs you can use to associate with the attribute group.
        public let tags: [String: String]?

        @inlinable
        public init(arn: String? = nil, creationTime: Date? = nil, description: String? = nil, id: String? = nil, lastUpdateTime: Date? = nil, name: String? = nil, tags: [String: String]? = nil) {
            self.arn = arn
            self.creationTime = creationTime
            self.description = description
            self.id = id
            self.lastUpdateTime = lastUpdateTime
            self.name = name
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case creationTime = "creationTime"
            case description = "description"
            case id = "id"
            case lastUpdateTime = "lastUpdateTime"
            case name = "name"
            case tags = "tags"
        }
    }

    public struct AttributeGroupDetails: AWSDecodableShape {
        /// The Amazon resource name (ARN) that specifies the attribute group.
        public let arn: String?
        /// The service principal that created the attribute group.
        public let createdBy: String?
        /// The unique identifier of the attribute group.
        public let id: String?
        ///   This field is no longer supported. We recommend you don't use the field when using ListAttributeGroupsForApplication.    The name of the attribute group.
        public let name: String?

        @inlinable
        public init(arn: String? = nil, createdBy: String? = nil, id: String? = nil, name: String? = nil) {
            self.arn = arn
            self.createdBy = createdBy
            self.id = id
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case createdBy = "createdBy"
            case id = "id"
            case name = "name"
        }
    }

    public struct AttributeGroupSummary: AWSDecodableShape {
        /// The Amazon resource name (ARN) that specifies the attribute group across services.
        public let arn: String?
        /// The service principal that created the attribute group.
        public let createdBy: String?
        /// The ISO-8601 formatted timestamp of the moment the attribute group was created.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var creationTime: Date?
        /// The description of the attribute group that the user provides.
        public let description: String?
        /// The globally unique attribute group identifier of the attribute group.
        public let id: String?
        /// The ISO-8601 formatted timestamp of the moment the attribute group was last updated. This time is the same as the creationTime for a newly created attribute group.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var lastUpdateTime: Date?
        /// The name of the attribute group.
        public let name: String?

        @inlinable
        public init(arn: String? = nil, createdBy: String? = nil, creationTime: Date? = nil, description: String? = nil, id: String? = nil, lastUpdateTime: Date? = nil, name: String? = nil) {
            self.arn = arn
            self.createdBy = createdBy
            self.creationTime = creationTime
            self.description = description
            self.id = id
            self.lastUpdateTime = lastUpdateTime
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case createdBy = "createdBy"
            case creationTime = "creationTime"
            case description = "description"
            case id = "id"
            case lastUpdateTime = "lastUpdateTime"
            case name = "name"
        }
    }

    public struct CreateApplicationRequest: AWSEncodableShape {
        /// A unique identifier that you provide to ensure idempotency. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, the retry fails.
        public let clientToken: String
        /// The description of the application.
        public let description: String?
        /// The name of the application. The name must be unique in the region in which you are creating the application.
        public let name: String
        /// Key-value pairs you can use to associate with the application.
        public let tags: [String: String]?

        @inlinable
        public init(clientToken: String = CreateApplicationRequest.idempotencyToken(), description: String? = nil, name: String, tags: [String: String]? = nil) {
            self.clientToken = clientToken
            self.description = description
            self.name = name
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 128)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_-]*$")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[-.\\w]+$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]*)$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case clientToken = "clientToken"
            case description = "description"
            case name = "name"
            case tags = "tags"
        }
    }

    public struct CreateApplicationResponse: AWSDecodableShape {
        /// Information about the application.
        public let application: Application?

        @inlinable
        public init(application: Application? = nil) {
            self.application = application
        }

        private enum CodingKeys: String, CodingKey {
            case application = "application"
        }
    }

    public struct CreateAttributeGroupRequest: AWSEncodableShape {
        /// A JSON string in the form of nested key-value pairs that represent the attributes in the group and describes an application and its components.
        public let attributes: String
        /// A unique identifier that you provide to ensure idempotency. If you retry a request that completed successfully using the same client token and the same parameters, the retry succeeds without performing any further actions. If you retry a successful request using the same client token, but one or more of the parameters are different, the retry fails.
        public let clientToken: String
        /// The description of the attribute group that the user provides.
        public let description: String?
        /// The name of the attribute group.
        public let name: String
        /// Key-value pairs you can use to associate with the attribute group.
        public let tags: [String: String]?

        @inlinable
        public init(attributes: String, clientToken: String = CreateAttributeGroupRequest.idempotencyToken(), description: String? = nil, name: String, tags: [String: String]? = nil) {
            self.attributes = attributes
            self.clientToken = clientToken
            self.description = description
            self.name = name
            self.tags = tags
        }

        public func validate(name: String) throws {
            try self.validate(self.attributes, name: "attributes", parent: name, max: 8000)
            try self.validate(self.attributes, name: "attributes", parent: name, min: 1)
            try self.validate(self.attributes, name: "attributes", parent: name, pattern: "^[\\u0009\\u000A\\u000D\\u0020-\\u00FF]+$")
            try self.validate(self.clientToken, name: "clientToken", parent: name, max: 128)
            try self.validate(self.clientToken, name: "clientToken", parent: name, min: 1)
            try self.validate(self.clientToken, name: "clientToken", parent: name, pattern: "^[a-zA-Z0-9][a-zA-Z0-9_-]*$")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[-.\\w]+$")
            try self.tags?.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]*)$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case attributes = "attributes"
            case clientToken = "clientToken"
            case description = "description"
            case name = "name"
            case tags = "tags"
        }
    }

    public struct CreateAttributeGroupResponse: AWSDecodableShape {
        /// Information about the attribute group.
        public let attributeGroup: AttributeGroup?

        @inlinable
        public init(attributeGroup: AttributeGroup? = nil) {
            self.attributeGroup = attributeGroup
        }

        private enum CodingKeys: String, CodingKey {
            case attributeGroup = "attributeGroup"
        }
    }

    public struct DeleteApplicationRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the application.
        public let application: String

        @inlinable
        public init(application: String) {
            self.application = application
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteApplicationResponse: AWSDecodableShape {
        /// Information about the deleted application.
        public let application: ApplicationSummary?

        @inlinable
        public init(application: ApplicationSummary? = nil) {
            self.application = application
        }

        private enum CodingKeys: String, CodingKey {
            case application = "application"
        }
    }

    public struct DeleteAttributeGroupRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the attribute group  that holds the attributes  to describe the application.
        public let attributeGroup: String

        @inlinable
        public init(attributeGroup: String) {
            self.attributeGroup = attributeGroup
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.attributeGroup, key: "attributeGroup")
        }

        public func validate(name: String) throws {
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, max: 512)
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, min: 1)
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/attribute-groups/[-.\\w]+)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DeleteAttributeGroupResponse: AWSDecodableShape {
        /// Information about the deleted attribute group.
        public let attributeGroup: AttributeGroupSummary?

        @inlinable
        public init(attributeGroup: AttributeGroupSummary? = nil) {
            self.attributeGroup = attributeGroup
        }

        private enum CodingKeys: String, CodingKey {
            case attributeGroup = "attributeGroup"
        }
    }

    public struct DisassociateAttributeGroupRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the application.
        public let application: String
        ///  The name, ID, or ARN  of the attribute group  that holds the attributes  to describe the application.
        public let attributeGroup: String

        @inlinable
        public init(application: String, attributeGroup: String) {
            self.application = application
            self.attributeGroup = attributeGroup
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
            request.encodePath(self.attributeGroup, key: "attributeGroup")
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, max: 512)
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, min: 1)
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/attribute-groups/[-.\\w]+)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DisassociateAttributeGroupResponse: AWSDecodableShape {
        /// The Amazon resource name (ARN) that specifies the application.
        public let applicationArn: String?
        /// The Amazon resource name (ARN) that specifies the attribute group.
        public let attributeGroupArn: String?

        @inlinable
        public init(applicationArn: String? = nil, attributeGroupArn: String? = nil) {
            self.applicationArn = applicationArn
            self.attributeGroupArn = attributeGroupArn
        }

        private enum CodingKeys: String, CodingKey {
            case applicationArn = "applicationArn"
            case attributeGroupArn = "attributeGroupArn"
        }
    }

    public struct DisassociateResourceRequest: AWSEncodableShape {
        /// The name or ID of the application.
        public let application: String
        /// The name or ID of the resource.
        public let resource: String
        /// The type of the resource that is being disassociated.
        public let resourceType: ResourceType

        @inlinable
        public init(application: String, resource: String, resourceType: ResourceType) {
            self.application = application
            self.resource = resource
            self.resourceType = resourceType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
            request.encodePath(self.resource, key: "resource")
            request.encodePath(self.resourceType, key: "resourceType")
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
            try self.validate(self.resource, name: "resource", parent: name, max: 256)
            try self.validate(self.resource, name: "resource", parent: name, min: 1)
            try self.validate(self.resource, name: "resource", parent: name, pattern: "^\\S+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct DisassociateResourceResponse: AWSDecodableShape {
        /// The Amazon resource name (ARN) that specifies the application.
        public let applicationArn: String?
        /// The Amazon resource name (ARN) that specifies the resource.
        public let resourceArn: String?

        @inlinable
        public init(applicationArn: String? = nil, resourceArn: String? = nil) {
            self.applicationArn = applicationArn
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case applicationArn = "applicationArn"
            case resourceArn = "resourceArn"
        }
    }

    public struct GetApplicationRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the application.
        public let application: String

        @inlinable
        public init(application: String) {
            self.application = application
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetApplicationResponse: AWSDecodableShape {
        ///  A key-value pair that identifies an associated resource.
        public let applicationTag: [String: String]?
        /// The Amazon resource name (ARN) that specifies the application across services.
        public let arn: String?
        /// The number of top-level resources that were registered as part of this application.
        public let associatedResourceCount: Int?
        /// The ISO-8601 formatted timestamp of the moment when the application was created.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var creationTime: Date?
        /// The description of the application.
        public let description: String?
        /// The identifier of the application.
        public let id: String?
        ///  The information  about the integration  of the application  with other services,  such as Resource Groups.
        public let integrations: Integrations?
        /// The ISO-8601 formatted timestamp of the moment when the application was last updated.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var lastUpdateTime: Date?
        /// The name of the application. The name must be unique in the region in which you are creating the application.
        public let name: String?
        /// Key-value pairs associated with the application.
        public let tags: [String: String]?

        @inlinable
        public init(applicationTag: [String: String]? = nil, arn: String? = nil, associatedResourceCount: Int? = nil, creationTime: Date? = nil, description: String? = nil, id: String? = nil, integrations: Integrations? = nil, lastUpdateTime: Date? = nil, name: String? = nil, tags: [String: String]? = nil) {
            self.applicationTag = applicationTag
            self.arn = arn
            self.associatedResourceCount = associatedResourceCount
            self.creationTime = creationTime
            self.description = description
            self.id = id
            self.integrations = integrations
            self.lastUpdateTime = lastUpdateTime
            self.name = name
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case applicationTag = "applicationTag"
            case arn = "arn"
            case associatedResourceCount = "associatedResourceCount"
            case creationTime = "creationTime"
            case description = "description"
            case id = "id"
            case integrations = "integrations"
            case lastUpdateTime = "lastUpdateTime"
            case name = "name"
            case tags = "tags"
        }
    }

    public struct GetAssociatedResourceRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the application.
        public let application: String
        ///  The maximum number of results to return. If the parameter is omitted, it defaults to 25. The value is optional.
        public let maxResults: Int?
        ///  A unique pagination token for each page of results.  Make the call again with the returned token to retrieve the next page of results.
        public let nextToken: String?
        /// The name or ID of the resource associated with the application.
        public let resource: String
        ///  States whether an application tag is applied, not applied, in the process of being applied, or skipped.
        public let resourceTagStatus: [ResourceItemStatus]?
        /// The type of resource associated with the application.
        public let resourceType: ResourceType

        @inlinable
        public init(application: String, maxResults: Int? = nil, nextToken: String? = nil, resource: String, resourceTagStatus: [ResourceItemStatus]? = nil, resourceType: ResourceType) {
            self.application = application
            self.maxResults = maxResults
            self.nextToken = nextToken
            self.resource = resource
            self.resourceTagStatus = resourceTagStatus
            self.resourceType = resourceType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
            request.encodePath(self.resource, key: "resource")
            request.encodeQuery(self.resourceTagStatus, key: "resourceTagStatus")
            request.encodePath(self.resourceType, key: "resourceType")
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z0-9+/=]+$")
            try self.validate(self.resource, name: "resource", parent: name, max: 256)
            try self.validate(self.resource, name: "resource", parent: name, min: 1)
            try self.validate(self.resource, name: "resource", parent: name, pattern: "^\\S+$")
            try self.validate(self.resourceTagStatus, name: "resourceTagStatus", parent: name, max: 4)
            try self.validate(self.resourceTagStatus, name: "resourceTagStatus", parent: name, min: 1)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetAssociatedResourceResponse: AWSDecodableShape {
        ///  The result of the application that's tag applied to a resource.
        public let applicationTagResult: ApplicationTagResult?
        ///  Determines whether an application tag is applied or skipped.
        public let options: [AssociationOption]?
        /// The resource associated with the application.
        public let resource: Resource?

        @inlinable
        public init(applicationTagResult: ApplicationTagResult? = nil, options: [AssociationOption]? = nil, resource: Resource? = nil) {
            self.applicationTagResult = applicationTagResult
            self.options = options
            self.resource = resource
        }

        private enum CodingKeys: String, CodingKey {
            case applicationTagResult = "applicationTagResult"
            case options = "options"
            case resource = "resource"
        }
    }

    public struct GetAttributeGroupRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the attribute group  that holds the attributes  to describe the application.
        public let attributeGroup: String

        @inlinable
        public init(attributeGroup: String) {
            self.attributeGroup = attributeGroup
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.attributeGroup, key: "attributeGroup")
        }

        public func validate(name: String) throws {
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, max: 512)
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, min: 1)
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/attribute-groups/[-.\\w]+)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct GetAttributeGroupResponse: AWSDecodableShape {
        /// The Amazon resource name (ARN) that specifies the attribute group across services.
        public let arn: String?
        /// A JSON string in the form of nested key-value pairs that represent the attributes in the group and describes an application and its components.
        public let attributes: String?
        /// The service principal that created the attribute group.
        public let createdBy: String?
        /// The ISO-8601 formatted timestamp of the moment the attribute group was created.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var creationTime: Date?
        /// The description of the attribute group that the user provides.
        public let description: String?
        /// The identifier of the attribute group.
        public let id: String?
        /// The ISO-8601 formatted timestamp of the moment the attribute group was last updated. This time is the same as the creationTime for a newly created attribute group.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var lastUpdateTime: Date?
        /// The name of the attribute group.
        public let name: String?
        /// Key-value pairs associated with the attribute group.
        public let tags: [String: String]?

        @inlinable
        public init(arn: String? = nil, attributes: String? = nil, createdBy: String? = nil, creationTime: Date? = nil, description: String? = nil, id: String? = nil, lastUpdateTime: Date? = nil, name: String? = nil, tags: [String: String]? = nil) {
            self.arn = arn
            self.attributes = attributes
            self.createdBy = createdBy
            self.creationTime = creationTime
            self.description = description
            self.id = id
            self.lastUpdateTime = lastUpdateTime
            self.name = name
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case attributes = "attributes"
            case createdBy = "createdBy"
            case creationTime = "creationTime"
            case description = "description"
            case id = "id"
            case lastUpdateTime = "lastUpdateTime"
            case name = "name"
            case tags = "tags"
        }
    }

    public struct GetConfigurationResponse: AWSDecodableShape {
        ///  Retrieves TagKey configuration  from an account.
        public let configuration: AppRegistryConfiguration?

        @inlinable
        public init(configuration: AppRegistryConfiguration? = nil) {
            self.configuration = configuration
        }

        private enum CodingKeys: String, CodingKey {
            case configuration = "configuration"
        }
    }

    public struct Integrations: AWSDecodableShape {
        public let applicationTagResourceGroup: ResourceGroup?
        ///  The information about the resource group integration.
        public let resourceGroup: ResourceGroup?

        @inlinable
        public init(applicationTagResourceGroup: ResourceGroup? = nil, resourceGroup: ResourceGroup? = nil) {
            self.applicationTagResourceGroup = applicationTagResourceGroup
            self.resourceGroup = resourceGroup
        }

        private enum CodingKeys: String, CodingKey {
            case applicationTagResourceGroup = "applicationTagResourceGroup"
            case resourceGroup = "resourceGroup"
        }
    }

    public struct ListApplicationsRequest: AWSEncodableShape {
        /// The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
        public let maxResults: Int?
        /// The token to use to get the next page of results after a previous API call.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z0-9+/=]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListApplicationsResponse: AWSDecodableShape {
        /// This list of applications.
        public let applications: [ApplicationSummary]?
        /// The token to use to get the next page of results after a previous API call.
        public let nextToken: String?

        @inlinable
        public init(applications: [ApplicationSummary]? = nil, nextToken: String? = nil) {
            self.applications = applications
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case applications = "applications"
            case nextToken = "nextToken"
        }
    }

    public struct ListAssociatedAttributeGroupsRequest: AWSEncodableShape {
        /// The name or ID of the application.
        public let application: String
        /// The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
        public let maxResults: Int?
        /// The token to use to get the next page of results after a previous API call.
        public let nextToken: String?

        @inlinable
        public init(application: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.application = application
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z0-9+/=]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListAssociatedAttributeGroupsResponse: AWSDecodableShape {
        /// A list of attribute group IDs.
        public let attributeGroups: [String]?
        /// The token to use to get the next page of results after a previous API call.
        public let nextToken: String?

        @inlinable
        public init(attributeGroups: [String]? = nil, nextToken: String? = nil) {
            self.attributeGroups = attributeGroups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case attributeGroups = "attributeGroups"
            case nextToken = "nextToken"
        }
    }

    public struct ListAssociatedResourcesRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the application.
        public let application: String
        /// The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
        public let maxResults: Int?
        /// The token to use to get the next page of results after a previous API call.
        public let nextToken: String?

        @inlinable
        public init(application: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.application = application
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z0-9+/=]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListAssociatedResourcesResponse: AWSDecodableShape {
        /// The token to use to get the next page of results after a previous API call.
        public let nextToken: String?
        /// Information about the resources.
        public let resources: [ResourceInfo]?

        @inlinable
        public init(nextToken: String? = nil, resources: [ResourceInfo]? = nil) {
            self.nextToken = nextToken
            self.resources = resources
        }

        private enum CodingKeys: String, CodingKey {
            case nextToken = "nextToken"
            case resources = "resources"
        }
    }

    public struct ListAttributeGroupsForApplicationRequest: AWSEncodableShape {
        /// The name or ID of the application.
        public let application: String
        /// The upper bound of the number of results to return. The value cannot exceed 25. If you omit this parameter, it defaults to 25. This value is optional.
        public let maxResults: Int?
        /// This token retrieves the next page of results after a previous API call.
        public let nextToken: String?

        @inlinable
        public init(application: String, maxResults: Int? = nil, nextToken: String? = nil) {
            self.application = application
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z0-9+/=]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListAttributeGroupsForApplicationResponse: AWSDecodableShape {
        ///  The details related to a specific attribute group.
        public let attributeGroupsDetails: [AttributeGroupDetails]?
        /// The token to use to get the next page of results after a previous API call.
        public let nextToken: String?

        @inlinable
        public init(attributeGroupsDetails: [AttributeGroupDetails]? = nil, nextToken: String? = nil) {
            self.attributeGroupsDetails = attributeGroupsDetails
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case attributeGroupsDetails = "attributeGroupsDetails"
            case nextToken = "nextToken"
        }
    }

    public struct ListAttributeGroupsRequest: AWSEncodableShape {
        /// The upper bound of the number of results to return (cannot exceed 25). If this parameter is omitted, it defaults to 25. This value is optional.
        public let maxResults: Int?
        /// The token to use to get the next page of results after a previous API call.
        public let nextToken: String?

        @inlinable
        public init(maxResults: Int? = nil, nextToken: String? = nil) {
            self.maxResults = maxResults
            self.nextToken = nextToken
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodeQuery(self.maxResults, key: "maxResults")
            request.encodeQuery(self.nextToken, key: "nextToken")
        }

        public func validate(name: String) throws {
            try self.validate(self.maxResults, name: "maxResults", parent: name, max: 100)
            try self.validate(self.maxResults, name: "maxResults", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, max: 2024)
            try self.validate(self.nextToken, name: "nextToken", parent: name, min: 1)
            try self.validate(self.nextToken, name: "nextToken", parent: name, pattern: "^[A-Za-z0-9+/=]+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListAttributeGroupsResponse: AWSDecodableShape {
        /// This list of attribute groups.
        public let attributeGroups: [AttributeGroupSummary]?
        /// The token to use to get the next page of results after a previous API call.
        public let nextToken: String?

        @inlinable
        public init(attributeGroups: [AttributeGroupSummary]? = nil, nextToken: String? = nil) {
            self.attributeGroups = attributeGroups
            self.nextToken = nextToken
        }

        private enum CodingKeys: String, CodingKey {
            case attributeGroups = "attributeGroups"
            case nextToken = "nextToken"
        }
    }

    public struct ListTagsForResourceRequest: AWSEncodableShape {
        /// The Amazon resource name (ARN) that specifies the resource.
        public let resourceArn: String

        @inlinable
        public init(resourceArn: String) {
            self.resourceArn = resourceArn
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "resourceArn")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct ListTagsForResourceResponse: AWSDecodableShape {
        /// The tags on the resource.
        public let tags: [String: String]?

        @inlinable
        public init(tags: [String: String]? = nil) {
            self.tags = tags
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "tags"
        }
    }

    public struct PutConfigurationRequest: AWSEncodableShape {
        ///  Associates a TagKey configuration  to an account.
        public let configuration: AppRegistryConfiguration

        @inlinable
        public init(configuration: AppRegistryConfiguration) {
            self.configuration = configuration
        }

        public func validate(name: String) throws {
            try self.configuration.validate(name: "\(name).configuration")
        }

        private enum CodingKeys: String, CodingKey {
            case configuration = "configuration"
        }
    }

    public struct Resource: AWSDecodableShape {
        /// The Amazon resource name (ARN) of the resource.
        public let arn: String?
        /// The time the resource was associated with the application.
        @OptionalCustomCoding<ISO8601DateCoder>
        public var associationTime: Date?
        /// The service integration information about the resource.
        public let integrations: ResourceIntegrations?
        /// The name of the resource.
        public let name: String?

        @inlinable
        public init(arn: String? = nil, associationTime: Date? = nil, integrations: ResourceIntegrations? = nil, name: String? = nil) {
            self.arn = arn
            self.associationTime = associationTime
            self.integrations = integrations
            self.name = name
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case associationTime = "associationTime"
            case integrations = "integrations"
            case name = "name"
        }
    }

    public struct ResourceDetails: AWSDecodableShape {
        /// The value of the tag.
        public let tagValue: String?

        @inlinable
        public init(tagValue: String? = nil) {
            self.tagValue = tagValue
        }

        private enum CodingKeys: String, CodingKey {
            case tagValue = "tagValue"
        }
    }

    public struct ResourceGroup: AWSDecodableShape {
        /// The Amazon resource name (ARN) of the resource group.
        public let arn: String?
        /// The error message that generates when the propagation process for the resource group fails.
        public let errorMessage: String?
        /// The state of the propagation process for the resource group. The states includes:  CREATING if the resource group is in the process of being created.  CREATE_COMPLETE if the resource group was created successfully.  CREATE_FAILED if the resource group failed to be created.  UPDATING if the resource group is in the process of being updated.  UPDATE_COMPLETE if the resource group updated successfully.  UPDATE_FAILED if the resource group could not update successfully.
        public let state: ResourceGroupState?

        @inlinable
        public init(arn: String? = nil, errorMessage: String? = nil, state: ResourceGroupState? = nil) {
            self.arn = arn
            self.errorMessage = errorMessage
            self.state = state
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case errorMessage = "errorMessage"
            case state = "state"
        }
    }

    public struct ResourceInfo: AWSDecodableShape {
        /// The Amazon resource name (ARN) that specifies the resource across services.
        public let arn: String?
        /// The name of the resource.
        public let name: String?
        ///  Determines whether an application tag is applied or skipped.
        public let options: [AssociationOption]?
        ///  The details related to the resource.
        public let resourceDetails: ResourceDetails?
        ///  Provides information  about the Service Catalog App Registry resource type.
        public let resourceType: ResourceType?

        @inlinable
        public init(arn: String? = nil, name: String? = nil, options: [AssociationOption]? = nil, resourceDetails: ResourceDetails? = nil, resourceType: ResourceType? = nil) {
            self.arn = arn
            self.name = name
            self.options = options
            self.resourceDetails = resourceDetails
            self.resourceType = resourceType
        }

        private enum CodingKeys: String, CodingKey {
            case arn = "arn"
            case name = "name"
            case options = "options"
            case resourceDetails = "resourceDetails"
            case resourceType = "resourceType"
        }
    }

    public struct ResourceIntegrations: AWSDecodableShape {
        /// The information about the integration of Resource Groups.
        public let resourceGroup: ResourceGroup?

        @inlinable
        public init(resourceGroup: ResourceGroup? = nil) {
            self.resourceGroup = resourceGroup
        }

        private enum CodingKeys: String, CodingKey {
            case resourceGroup = "resourceGroup"
        }
    }

    public struct ResourcesListItem: AWSDecodableShape {
        ///  The message returned if the call fails.
        public let errorMessage: String?
        ///  The Amazon resource name (ARN) of the resource.
        public let resourceArn: String?
        ///  Provides information about the AppRegistry resource type.
        public let resourceType: String?
        ///  The status of the list item.
        public let status: String?

        @inlinable
        public init(errorMessage: String? = nil, resourceArn: String? = nil, resourceType: String? = nil, status: String? = nil) {
            self.errorMessage = errorMessage
            self.resourceArn = resourceArn
            self.resourceType = resourceType
            self.status = status
        }

        private enum CodingKeys: String, CodingKey {
            case errorMessage = "errorMessage"
            case resourceArn = "resourceArn"
            case resourceType = "resourceType"
            case status = "status"
        }
    }

    public struct SyncResourceRequest: AWSEncodableShape {
        /// An entity you can work with and specify with a name or ID. Examples include an Amazon EC2 instance, an Amazon Web Services CloudFormation stack, or an Amazon S3 bucket.
        public let resource: String
        /// The type of resource of which the application will be associated.
        public let resourceType: ResourceType

        @inlinable
        public init(resource: String, resourceType: ResourceType) {
            self.resource = resource
            self.resourceType = resourceType
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resource, key: "resource")
            request.encodePath(self.resourceType, key: "resourceType")
        }

        public func validate(name: String) throws {
            try self.validate(self.resource, name: "resource", parent: name, max: 256)
            try self.validate(self.resource, name: "resource", parent: name, min: 1)
            try self.validate(self.resource, name: "resource", parent: name, pattern: "^\\S+$")
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct SyncResourceResponse: AWSDecodableShape {
        /// The results of the output if an application is associated with an ARN value, which could be syncStarted or None.
        public let actionTaken: SyncAction?
        /// The Amazon resource name (ARN) that specifies the application.
        public let applicationArn: String?
        /// The Amazon resource name (ARN) that specifies the resource.
        public let resourceArn: String?

        @inlinable
        public init(actionTaken: SyncAction? = nil, applicationArn: String? = nil, resourceArn: String? = nil) {
            self.actionTaken = actionTaken
            self.applicationArn = applicationArn
            self.resourceArn = resourceArn
        }

        private enum CodingKeys: String, CodingKey {
            case actionTaken = "actionTaken"
            case applicationArn = "applicationArn"
            case resourceArn = "resourceArn"
        }
    }

    public struct TagQueryConfiguration: AWSEncodableShape & AWSDecodableShape {
        ///  Condition  in the IAM policy  that associates resources  to an application.
        public let tagKey: String?

        @inlinable
        public init(tagKey: String? = nil) {
            self.tagKey = tagKey
        }

        public func validate(name: String) throws {
            try self.validate(self.tagKey, name: "tagKey", parent: name, max: 128)
            try self.validate(self.tagKey, name: "tagKey", parent: name, pattern: "^(?!\\s+$)[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*$")
        }

        private enum CodingKeys: String, CodingKey {
            case tagKey = "tagKey"
        }
    }

    public struct TagResourceRequest: AWSEncodableShape {
        /// The Amazon resource name (ARN) that specifies the resource.
        public let resourceArn: String
        /// The new or modified tags for the resource.
        public let tags: [String: String]

        @inlinable
        public init(resourceArn: String, tags: [String: String]) {
            self.resourceArn = resourceArn
            self.tags = tags
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "resourceArn")
            try container.encode(self.tags, forKey: .tags)
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)$")
            try self.tags.forEach {
                try validate($0.key, name: "tags.key", parent: name, max: 128)
                try validate($0.key, name: "tags.key", parent: name, min: 1)
                try validate($0.key, name: "tags.key", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]*)$")
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, max: 256)
                try validate($0.value, name: "tags[\"\($0.key)\"]", parent: name, pattern: "^[\\p{L}\\p{Z}\\p{N}_.:/=+\\-@]*$")
            }
            try self.validate(self.tags, name: "tags", parent: name, max: 50)
        }

        private enum CodingKeys: String, CodingKey {
            case tags = "tags"
        }
    }

    public struct TagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct ThrottlingException: AWSErrorShape {
        /// A message associated with the Throttling exception.
        public let message: String
        /// The originating service code.
        public let serviceCode: String?

        @inlinable
        public init(message: String, serviceCode: String? = nil) {
            self.message = message
            self.serviceCode = serviceCode
        }

        private enum CodingKeys: String, CodingKey {
            case message = "message"
            case serviceCode = "serviceCode"
        }
    }

    public struct UntagResourceRequest: AWSEncodableShape {
        /// The Amazon resource name (ARN) that specifies the resource.
        public let resourceArn: String
        /// A list of the tag keys to remove from the specified resource.
        public let tagKeys: [String]

        @inlinable
        public init(resourceArn: String, tagKeys: [String]) {
            self.resourceArn = resourceArn
            self.tagKeys = tagKeys
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            _ = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.resourceArn, key: "resourceArn")
            request.encodeQuery(self.tagKeys, key: "tagKeys")
        }

        public func validate(name: String) throws {
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, max: 1600)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, min: 1)
            try self.validate(self.resourceArn, name: "resourceArn", parent: name, pattern: "^arn:(aws[a-zA-Z0-9-]*):([a-zA-Z0-9\\-])+:([a-z]{2}(-gov)?-[a-z]+-\\d{1})?:(\\d{12})?:(.*)$")
            try self.tagKeys.forEach {
                try validate($0, name: "tagKeys[]", parent: name, max: 128)
                try validate($0, name: "tagKeys[]", parent: name, min: 1)
                try validate($0, name: "tagKeys[]", parent: name, pattern: "^([\\p{L}\\p{Z}\\p{N}_.:\\/=+\\-@]*)$")
            }
            try self.validate(self.tagKeys, name: "tagKeys", parent: name, max: 50)
        }

        private enum CodingKeys: CodingKey {}
    }

    public struct UntagResourceResponse: AWSDecodableShape {
        public init() {}
    }

    public struct UpdateApplicationRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the application  that will be updated.
        public let application: String
        /// The new description of the application.
        public let description: String?
        /// Deprecated: The new name of the application. The name must be unique in the region in which you are updating the application. Please do not use this field as we have stopped supporting name updates.
        public let name: String?

        @inlinable
        public init(application: String, description: String? = nil) {
            self.application = application
            self.description = description
            self.name = nil
        }

        @available(*, deprecated, message: "Members name have been deprecated")
        @inlinable
        public init(application: String, description: String? = nil, name: String? = nil) {
            self.application = application
            self.description = description
            self.name = name
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.application, key: "application")
            try container.encodeIfPresent(self.description, forKey: .description)
            try container.encodeIfPresent(self.name, forKey: .name)
        }

        public func validate(name: String) throws {
            try self.validate(self.application, name: "application", parent: name, max: 256)
            try self.validate(self.application, name: "application", parent: name, min: 1)
            try self.validate(self.application, name: "application", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/applications/[-.\\w]+)$")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[-.\\w]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case description = "description"
            case name = "name"
        }
    }

    public struct UpdateApplicationResponse: AWSDecodableShape {
        /// The updated information of the application.
        public let application: Application?

        @inlinable
        public init(application: Application? = nil) {
            self.application = application
        }

        private enum CodingKeys: String, CodingKey {
            case application = "application"
        }
    }

    public struct UpdateAttributeGroupRequest: AWSEncodableShape {
        ///  The name, ID, or ARN  of the attribute group  that holds the attributes  to describe the application.
        public let attributeGroup: String
        /// A JSON string in the form of nested key-value pairs that represent the attributes in the group and describes an application and its components.
        public let attributes: String?
        /// The description of the attribute group that the user provides.
        public let description: String?
        /// Deprecated: The new name of the attribute group. The name must be unique in the region in which you are updating the attribute group. Please do not use this field as we have stopped supporting name updates.
        public let name: String?

        @inlinable
        public init(attributeGroup: String, attributes: String? = nil, description: String? = nil) {
            self.attributeGroup = attributeGroup
            self.attributes = attributes
            self.description = description
            self.name = nil
        }

        @available(*, deprecated, message: "Members name have been deprecated")
        @inlinable
        public init(attributeGroup: String, attributes: String? = nil, description: String? = nil, name: String? = nil) {
            self.attributeGroup = attributeGroup
            self.attributes = attributes
            self.description = description
            self.name = name
        }

        public func encode(to encoder: Encoder) throws {
            let request = encoder.userInfo[.awsRequest]! as! RequestEncodingContainer
            var container = encoder.container(keyedBy: CodingKeys.self)
            request.encodePath(self.attributeGroup, key: "attributeGroup")
            try container.encodeIfPresent(self.attributes, forKey: .attributes)
            try container.encodeIfPresent(self.description, forKey: .description)
            try container.encodeIfPresent(self.name, forKey: .name)
        }

        public func validate(name: String) throws {
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, max: 512)
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, min: 1)
            try self.validate(self.attributeGroup, name: "attributeGroup", parent: name, pattern: "^([-.\\w]+)|(arn:aws[-a-z]*:servicecatalog:[a-z]{2}(-gov)?-[a-z]+-\\d:\\d{12}:/attribute-groups/[-.\\w]+)$")
            try self.validate(self.attributes, name: "attributes", parent: name, max: 8000)
            try self.validate(self.attributes, name: "attributes", parent: name, min: 1)
            try self.validate(self.attributes, name: "attributes", parent: name, pattern: "^[\\u0009\\u000A\\u000D\\u0020-\\u00FF]+$")
            try self.validate(self.description, name: "description", parent: name, max: 1024)
            try self.validate(self.name, name: "name", parent: name, max: 256)
            try self.validate(self.name, name: "name", parent: name, min: 1)
            try self.validate(self.name, name: "name", parent: name, pattern: "^[-.\\w]+$")
        }

        private enum CodingKeys: String, CodingKey {
            case attributes = "attributes"
            case description = "description"
            case name = "name"
        }
    }

    public struct UpdateAttributeGroupResponse: AWSDecodableShape {
        /// The updated information of the attribute group.
        public let attributeGroup: AttributeGroup?

        @inlinable
        public init(attributeGroup: AttributeGroup? = nil) {
            self.attributeGroup = attributeGroup
        }

        private enum CodingKeys: String, CodingKey {
            case attributeGroup = "attributeGroup"
        }
    }
}

// MARK: - Errors

/// Error enum for ServiceCatalogAppRegistry
public struct ServiceCatalogAppRegistryErrorType: AWSErrorType {
    enum Code: String {
        case conflictException = "ConflictException"
        case internalServerException = "InternalServerException"
        case resourceNotFoundException = "ResourceNotFoundException"
        case serviceQuotaExceededException = "ServiceQuotaExceededException"
        case throttlingException = "ThrottlingException"
        case validationException = "ValidationException"
    }

    private let error: Code
    public let context: AWSErrorContext?

    /// initialize ServiceCatalogAppRegistry
    public init?(errorCode: String, context: AWSErrorContext) {
        guard let error = Code(rawValue: errorCode) else { return nil }
        self.error = error
        self.context = context
    }

    internal init(_ error: Code) {
        self.error = error
        self.context = nil
    }

    /// return error code string
    public var errorCode: String { self.error.rawValue }

    /// There was a conflict when processing the request (for example, a resource with the given name already exists within the account).
    public static var conflictException: Self { .init(.conflictException) }
    /// The service is experiencing internal problems.
    public static var internalServerException: Self { .init(.internalServerException) }
    /// The specified resource does not exist.
    public static var resourceNotFoundException: Self { .init(.resourceNotFoundException) }
    ///  The maximum number  of resources per account  has been reached.
    public static var serviceQuotaExceededException: Self { .init(.serviceQuotaExceededException) }
    ///  The maximum number  of API requests  has been exceeded.
    public static var throttlingException: Self { .init(.throttlingException) }
    /// The request has invalid or missing parameters.
    public static var validationException: Self { .init(.validationException) }
}

extension ServiceCatalogAppRegistryErrorType: AWSServiceErrorType {
    public static let errorCodeMap: [String: AWSErrorShape.Type] = [
        "ThrottlingException": ServiceCatalogAppRegistry.ThrottlingException.self
    ]
}

extension ServiceCatalogAppRegistryErrorType: Equatable {
    public static func == (lhs: ServiceCatalogAppRegistryErrorType, rhs: ServiceCatalogAppRegistryErrorType) -> Bool {
        lhs.error == rhs.error
    }
}

extension ServiceCatalogAppRegistryErrorType: CustomStringConvertible {
    public var description: String {
        return "\(self.error.rawValue): \(self.message ?? "")"
    }
}
